import request from '@/config/axios'

export interface MaterialTitleVO {
  id: number
  title: string
  userId: number
}

// 查询标题分页
export const getMaterialTitlePage = async (params) => {
  return await request.get({ url: `/operate/material-title/page`, params })
}

// 查询标题详情
export const getMaterialTitle = async (id: number) => {
  return await request.get({ url: `/operate/material-title/get?id=` + id })
}

// 新增标题
export const createMaterialTitle = async (data: MaterialTitleVO) => {
  return await request.post({ url: `/operate/material-title/create`, data })
}

// 修改标题
export const updateMaterialTitle = async (data: MaterialTitleVO) => {
  return await request.put({ url: `/operate/material-title/update`, data })
}

// 删除标题
export const deleteMaterialTitle = async (id: number) => {
  return await request.delete({ url: `/operate/material-title/delete?id=` + id })
}

// 导出标题 Excel
export const exportMaterialTitle = async (params) => {
  return await request.download({ url: `/operate/material-title/export-excel`, params })
}